const mongoose = require('./connection')

const orderSchema = new mongoose.Schema({
    //订单号
    orderno: String,
    //订单时间(日期)
    time: Date,
    //是否堂食或者外带
    mode: String,
    //第一个商品的名称
    menuname: String,
    //取餐码
    code: String,
    //总价
    totalprice: String,
    //支付是否成功 (状态)
    status: String,
    //用户id
    userid:String,
    //用户名
    username:String,
})

const orderModel = mongoose.model('order', orderSchema,'order')

module.exports = orderModel